//
//  MainNavigationController.m
//  CP_PrjOne
//
//  Created by 明明方 on 2018/5/3.
//  Copyright © 2018年 明明方. All rights reserved.
//

#import "MainNavigationController.h"
#import "UIColor+Category.h"
@interface MainNavigationController ()

@end

@implementation MainNavigationController

-(id)initWithRootViewController:(UIViewController *)rootViewController {
    self = [super initWithRootViewController:rootViewController];
    if (self) {
//        #FF5C3F
        [self.navigationBar setBackgroundImage:[UIImage imageWithColor:[UIColor colorWithHexString:@"#FF5C3F"] size:self.view.size] forBarMetrics:UIBarMetricsDefault];
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    
}

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{
    if (self.childViewControllers.count > 0) {
        //自动隐藏和显示tabbar
        viewController.hidesBottomBarWhenPushed = YES;
    }
    [super pushViewController:viewController animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
